How Does Chatgpt Actually Work Why It Hallucinates? Artificial Intelligence Explained